<include file="Public:header" />

    <h3 class="title"><em>管理员</em><span><a href="{:U('add')}">+新增</a></span></h3>
	<div class="listbox">
        <form name="mform" method="post" action="{:U('index')}">
		<div class="search">
			<span>名称：</span><input name="username" type="text" id="username" class="ipt" size="30" value="{$pageInfo['username']}" />
            <select name="status" id="status" class="sel">
                <option value="">所有状态</option>
                <option value="1" style="color: #f30;">正常</option>
                <option value="2" style="color: #080;">禁用</option>
			</select>
            <script type="text/javascript">
			$(function(){
				$("#status").val("{$pageInfo['status']}");	
			});
			</script>
			<input type="submit" class="btn" value="搜索" />
        </div>
        </form>
        
        <form name="mform" method="post" action="{:U('doAction')}">
        <div class="toolbar">
			<select name="act" id="act" class="sel">
			<option value="delAll" style="color: #f00;">删除选定</option>
			</select>
			<input type="submit" class="btn" value="应用" onClick="if(IsCheck('id[]')==false){alert('请指定您要操作的ID！');return false;}else{return confirm('确认执行此操作吗？');}">
		</div>
                        
    	<table width="100%" border="0" cellspacing="1" cellpadding="0">
			<tr>
				<th><input type="checkbox" id="ChkAll" onClick="CheckAll(this.form)">选择</th>
				<th>用户名</th>
				<th>角色</th>
				<th>状态</th>
				<th>操作</th>
			</tr>
			
            <empty name="list">
			<tr><td colspan="8">无任何数据！</td></tr>
            <else/>
            	<volist name="list" id="row">
                <tr>
                    <td><gt name="row['id']" value="1"><input name="id[]" type="checkbox" value="{$row['id']}"></gt>{$row['id']}</td>
                    <td>{$row['username']}</td>
                    <td>{$roleText[$row['role_id']]}</td>
                    <td><eq name="row['status']" value="1">正常<else/>禁用</eq></td>
                    <td><a href="{:U('edit', array('id'=>$row['id']))}">编辑</a><gt name="row['id']" value="1"> | <a href="{:U('del', array('id'=>$row['id']))}" onclick="return confirm('你确定删除吗?');">删除</a></gt></td>
                </tr>
                </volist>
            </empty>
		</table>
		</form>
        <include file="Public:page" />
	</div>
<include file="Public:footer" />